package com.abctime.demo;

import android.app.Application;

import com.abctime.api.ABCLibraryApi;
import com.abctime.api.LibraryBackground;
import com.abctime.demo.eval_engine.ABCVoiceEvalEngine;

/**
 * description:
 * author: KisenHuang
 * email: KisenHuang@163.com
 * time: 2018/9/1 下午1:48
 */

public class JApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        ABCLibraryApi.init(this, "sdk761200000001", "a63623e86db5c31699cef42cffffffff");
        ABCLibraryApi.debug(BuildConfig.DEBUG);//切换调试环境，默认false-正式环境，true-测试环境
        ABCLibraryApi.setupSpeechEngine(new ABCVoiceEvalEngine());
        /* 注：
         *建议sdk中调起的支付界面设置为横屏
         *以免部分设备在横竖屏切换时出现问题
         */
        ABCLibraryApi.setupPaymentView(PaymentActivity.class);
        ABCLibraryApi.setupExchangeCodeView(ExchangeCodeActivity.class);

        //配置不同Level的绘本馆背景图片
//        ABCLibraryApi.setResConfig(LibraryBackground.BG_LEVEL_A, R.drawable.xxx);

        /*
         * 设置默认图片加载器
         * 可以根据自己app中的Glide版本进行兼容处理。
         */
        ABCLibraryApi.setImageStrategy(new GlideImageLoaderStrategy());
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        ABCLibraryApi.onTerminate();
    }
}
